package com.gukun.springboot.tdengine.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gukun.springboot.tdengine.domain.common.CommonResult;
import com.gukun.springboot.tdengine.dto.DataSubscriptionDto;
import com.gukun.springboot.tdengine.dto.ShowTableDto;
import com.gukun.springboot.tdengine.dto.SubmitTableDto;
import com.gukun.springboot.tdengine.service.collectormanage.CollectormanageService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.sql.SQLException;

@RequestMapping("/api/tdengine/collectorManage/")
@RestController
public class CollectorManageController {

    @Autowired
    private CollectormanageService collectormanageService;

    /**
     * 提交修改表信息
     *
     * @return 表信息
     */
    @Operation(summary = "提交修改表信息", description = "提交修改表信息")
    @PostMapping("/submitTableData")
    public CommonResult<SubmitTableDto> submitTableData(@RequestBody SubmitTableDto submitTableDto) throws SQLException, IOException {
        collectormanageService.submitTableData(submitTableDto);
        return CommonResult.success(submitTableDto);
    }
}
